From: Adel Gadllah Date: Thu, 4 Jul 2013 17:24:30 +0000 (+0200) Subject: appSwitcher: Add option to limit to the current workspace X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3920 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d0d981435a2c2ef74c1ff3619db7f76432fa2be0;p=gnome-shell.git appSwitcher: Add option to limit to the current workspace Add an option to limit the appSwitcher to the current workspace. For users that use workspaces for task separation this more convient then current behviour. While having to add an option is unfortunate there is no way to make both groups happy as workspaces usage differes between different users / types of users. https://bugzilla.gnome.org/show_bug.cgi?id=703538 --- diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in index a12e7807f..816a1bc4e 100644 --- a/data/org.gnome.shell.gschema.xml.in.in +++ b/data/org.gnome.shell.gschema.xml.in.in @@ -186,6 +186,19 @@ value here is from the GsmPresenceStatus enumeration. + + + false + Limit switcher to current workspace. + + If true, only applications that have windows on the current workspace are shown in the switcher. + Otherwise, all applications are included. + + + + diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 34d83e4cf..9d47d1e5f 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -436,8 +436,11 @@ const AppSwitcher = new Lang.Class({ this._arrows = []; let windowTracker = Shell.WindowTracker.get_default(); + let settings = new Gio.Settings({ schema: 'org.gnome.shell.app-switcher' }); + let workspace = settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace() + : null; let allWindows = global.display.get_tab_list(Meta.TabList.NORMAL, - global.screen, null); + global.screen, workspace); // Construct the AppIcons, add to the popup for (let i = 0; i < apps.length; i++) { @@ -447,7 +450,9 @@ const AppSwitcher = new Lang.Class({ appIcon.cachedWindows = allWindows.filter(function(w) { return windowTracker.get_window_app (w) == appIcon.app; }); - this._addIcon(appIcon); + if (workspace == null || appIcon.cachedWindows.length > 0) { + this._addIcon(appIcon); + } } this._curApp = -1;